# coding=utf-8
"""
下载视频文件
"""

import os
import time


def generate_now_time():
    return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))


video_path = "D:/gitee/download/"
links = []


def download_video(links):
    for url in links:
        print(f"{generate_now_time()} 正在下载 {url}")
        os.system(f"you-get --playlist -o {video_path} {url}")
        # os.system(f"you-get -o {video_path} {url}")
        print(f"{generate_now_time()} 下载完毕 {url}")


if __name__ == "__main__":
    print(f"{generate_now_time()} 开始下载视频")
    download_video(links)
    print(f"{generate_now_time()} 视频下载结束")